// Portions Below from Osmocom OP25
// NXDN Encoder (C) Copyright 2019 Max H. Parke KA1RBI
// thx gr-ysf fr_vch_decoder_bb_impl.cc * Copyright 2015 Mathias Weyland *
// OP25 is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3, or (at your option)
// any later version.
// 
// OP25 is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
// License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with OP25; see the file COPYING. If not, write to the Free
// Software Foundation, Inc., 51 Franklin Street, Boston, MA
// 02110-1301, USA.

static const uint8_t PERM_12_5[] = {
	0,12,24,36,48,
	1,13,25,37,49,
	2,14,26,38,50,
	3,15,27,39,51,
	4,16,28,40,52,
	5,17,29,41,53,
	6,18,30,42,54,
	7,19,31,43,55,
	8,20,32,44,56,
	9,21,33,45,57,
	10,22,34,46,58,
	11,23,35,47,59
};

static const uint8_t PERM_16_9[] = {
	0, 16, 32, 48, 64, 80, 96, 112, 128,
	1, 17, 33, 49, 65, 81, 97, 113, 129,
	2, 18, 34, 50, 66, 82, 98, 114, 130,
	3, 19, 35, 51, 67, 83, 99, 115, 131,
	4, 20, 36, 52, 68, 84, 100, 116, 132,
	5, 21, 37, 53, 69, 85, 101, 117, 133,
	6, 22, 38, 54, 70, 86, 102, 118, 134,
	7, 23, 39, 55, 71, 87, 103, 119, 135,
	8, 24, 40, 56, 72, 88, 104, 120, 136,
	9, 25, 41, 57, 73, 89, 105, 121, 137,
	10, 26, 42, 58, 74, 90, 106, 122, 138,
	11, 27, 43, 59, 75, 91, 107, 123, 139,
	12, 28, 44, 60, 76, 92, 108, 124, 140,
	13, 29, 45, 61, 77, 93, 109, 125, 141,
	14, 30, 46, 62, 78, 94, 110, 126, 142,
	15, 31, 47, 63, 79, 95, 111, 127, 143
};

static const uint16_t PERM_12_25[] = {
	0,12,24,36,48,60,72,84,96,108,120,132,144,156,168,180,192,204,216,228,240,252,264,276,288,
	1,13,25,37,49,61,73,85,97,109,121,133,145,157,169,181,193,205,217,229,241,253,265,277,289,
	2,14,26,38,50,62,74,86,98,110,122,134,146,158,170,182,194,206,218,230,242,254,266,278,290,
	3,15,27,39,51,63,75,87,99,111,123,135,147,159,171,183,195,207,219,231,243,255,267,279,291,
	4,16,28,40,52,64,76,88,100,112,124,136,148,160,172,184,196,208,220,232,244,256,268,280,292,
	5,17,29,41,53,65,77,89,101,113,125,137,149,161,173,185,197,209,221,233,245,257,269,281,293,
	6,18,30,42,54,66,78,90,102,114,126,138,150,162,174,186,198,210,222,234,246,258,270,282,294,
	7,19,31,43,55,67,79,91,103,115,127,139,151,163,175,187,199,211,223,235,247,259,271,283,295,
	8,20,32,44,56,68,80,92,104,116,128,140,152,164,176,188,200,212,224,236,248,260,272,284,296,
	9,21,33,45,57,69,81,93,105,117,129,141,153,165,177,189,201,213,225,237,249,261,273,285,297,
	10,22,34,46,58,70,82,94,106,118,130,142,154,166,178,190,202,214,226,238,250,262,274,286,298,
	11,23,35,47,59,71,83,95,107,119,131,143,155,167,179,191,203,215,227,239,251,263,275,287,299
};

static const uint16_t PERM_12_29[] = {
	0,12,24,36,48,60,72,84,96,108,120,132,144,156,168,180,192,204,216,228,240,252,264,276,288,300,312,324,336,
	1,13,25,37,49,61,73,85,97,109,121,133,145,157,169,181,193,205,217,229,241,253,265,277,289,301,313,325,337,
	2,14,26,38,50,62,74,86,98,110,122,134,146,158,170,182,194,206,218,230,242,254,266,278,290,302,314,326,338,
	3,15,27,39,51,63,75,87,99,111,123,135,147,159,171,183,195,207,219,231,243,255,267,279,291,303,315,327,339,
	4,16,28,40,52,64,76,88,100,112,124,136,148,160,172,184,196,208,220,232,244,256,268,280,292,304,316,328,340,
	5,17,29,41,53,65,77,89,101,113,125,137,149,161,173,185,197,209,221,233,245,257,269,281,293,305,317,329,341,
	6,18,30,42,54,66,78,90,102,114,126,138,150,162,174,186,198,210,222,234,246,258,270,282,294,306,318,330,342,
	7,19,31,43,55,67,79,91,103,115,127,139,151,163,175,187,199,211,223,235,247,259,271,283,295,307,319,331,343,
	8,20,32,44,56,68,80,92,104,116,128,140,152,164,176,188,200,212,224,236,248,260,272,284,296,308,320,332,344,
	9,21,33,45,57,69,81,93,105,117,129,141,153,165,177,189,201,213,225,237,249,261,273,285,297,309,321,333,345,
	10,22,34,46,58,70,82,94,106,118,130,142,154,166,178,190,202,214,226,238,250,262,274,286,298,310,322,334,346,
	11,23,35,47,59,71,83,95,107,119,131,143,155,167,179,191,203,215,227,239,251,263,275,287,299,311,323,335,347
};

